/**
 * 0: pc端
 * 1：ipad端
 * 2：iphone端
 */

;(function fBrowserRedirect() {
  const ua = navigator.userAgent
  const isMidp = ua.match(/midp/i) === 'midp'
  const isUc7 = ua.match(/rv:1.2.3.4/i) === 'rv:1.2.3.4'
  const isUc = ua.match(/ucweb/i) === 'ucweb'
  const isAndroid = ua.match(/android/i) === 'android'
  const isCE = ua.match(/windows ce/i) === 'windows ce'
  const isWM = ua.match(/windows mobile/i) === 'windows mobile'
  const isIphone = ua.indexOf('iPhone') !== -1
  const isIPad = !isIphone && 'ontouchend' in document
  if (isIPad || isIphone || isMidp || isUc7 || isUc || isAndroid || isCE || isWM) {
    window.equipment = 'wap'
  } else {
    window.equipment = 'pc'
  }
})()

// 浏览器窗口变化时的事件
// window.onresize = () => fBrowserRedirect()
